package com.accenture.job.executor.service.jobhandler.riskmodel;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.accenture.job.executor.mapper.RiskModelMapper;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;

/**
 * 新增分析组ShardDB数据
 *
 * @author binbin.a.zhang 2018-05-08
 */
@JobHandler(value = "InrestRiskModelHandler")
@Component
@Transactional
public class InrestRiskModelHandler extends IJobHandler {

	@Autowired
	RiskModelMapper riskModelMapper;

	@Override
	public ReturnT<String> execute(String param) throws Exception {
		XxlJobLogger.log("Accenture-JOB, Inrest RiskModel Handler.");
		int inrestOriginalExpenseRowCount = riskModelMapper.inrestOriginalExpense();
		XxlJobLogger.log("Accenture-JOB, Inrest RiskModel Handler inrestOriginalExpense InrestRowCount:" + inrestOriginalExpenseRowCount);
		int inrestNoncomplianceRowCount=riskModelMapper.inrestNoncompliance();
		XxlJobLogger.log("Accenture-JOB, Inrest RiskModel Handler inrestNoncompliance InrestRowCount:" + inrestNoncomplianceRowCount);
		int inrestCompleteExpenseRowCount=riskModelMapper.inrestCompleteExpense();
		XxlJobLogger.log("Accenture-JOB, Inrest RiskModel Handler inrestCompleteExpense InrestRowCount:" + inrestCompleteExpenseRowCount);
		return SUCCESS;
	}

}
